package com.md04.controller;

import com.md04.entity.Dept;
import com.md04.service.DeptService;
import lombok.Data;

import java.util.List;

@Data
public class DeptController {
    private DeptService deptService;//接口

    public List<Dept> selectAllDept() {

        return deptService.selectAllDept();

    }

    public Dept selectOneById(int id) {
        return deptService.selectOneById(id);

    }

    public String deleteById(int id) {

        return deptService.deleteById(id) ? "成功" : "失败";
    }

    public void addOne(Dept dept) {
        deptService.addOne(dept);

    }

    public void updateOne(Dept dept) {
        deptService.updateOne(dept);


    }

    ;


}
